﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wedo.Recognition.Domain.Models;

namespace Wedo.Recognition.Domain.Mapping
{
    public class ReleaseOrder_Mapping : EntityConfiguration<ReleaseOrder>
    {
        public ReleaseOrder_Mapping()
        {
            ToTable("ReleaseOrder");

            //HasRequired(b =>b.BankData).WithMany().HasForeignKey(b => b.BankDataId);
            //HasRequired(b => b.CheckRecord).WithMany().HasForeignKey(b => b.CheckRecordId);
            HasRequired(b => b.BankData).WithMany(m=>m.ReleaseOrder).HasForeignKey(b => b.BankDataID);

            Property(s => s.OrderNum).HasMaxLength(500);
            Property(s => s.Approver).HasMaxLength(50).HasColumnType("nvarchar");
            Property(s => s.ApplyMan).HasMaxLength(50).HasColumnType("nvarchar");

            Property(s => s.CustomerCode).HasMaxLength(50).HasColumnType("nvarchar");
            Property(s => s.CustomerName).HasMaxLength(50).HasColumnType("nvarchar");
        }
    }
}
